package main

import "fmt"

// k,v数据结构, K的类型可以是 bool, string, 指针, channel,
func main() {
	//map1 := make(mapdemo[uint]string, 10)
	//map1[1] = "zhangsan"
	//map1[2] = "lisi"
	//map1[3] = "wangwu"
	//map1[4] = "zhaoliu"
	//
	//fmt.Println(map1)
	test1()

}

type stu struct {
	num  string
	Name string
	Age  int
	addr string
}

func test1() {
	map1 := make(map[string]stu, 20)
	map1["001"] = stu{"001", "zhangsan", 22, "安徽"}

	map1["002"] = stu{"002", "lisi", 22, "北京"}
	map1["003"] = stu{"003", "wangwu", 32, "上海"}
	map1["004"] = stu{"004", "zhaoliu", 5, "浙江"}

	for k, v := range map1 {
		fmt.Println("学号是", k, "姓名是 ", v.Name)
		fmt.Println("年龄是 ", v.Age)
		fmt.Println()
	}

}
